package com.dyz.model;

public class Invoice {
	
	private String number, companyName, adress, descr;
	private float cenaNetto, cenaNettodod, cenaBrutto, kwotaVat;
	private float price ,  additionalPrice;
	private int vat;
	private static int counter = 1;
	private int invoiceNumber;
	private String date;
	private boolean isPrzychod;
	public int d,m,y;
	String type;
	public Invoice(int month){
		invoiceNumber = counter++;
		m = month;
	}
	public Invoice(String number, String companyName, String adress,
			String descr, float price, float additionalPrice, boolean isPrzychod) {
		super();
		this.number = number;
		this.companyName = companyName;
		this.adress = adress;
		this.descr = descr;
		this.vat = vat;
		invoiceNumber = counter++;
		this.date = date;
		this.isPrzychod = isPrzychod;
		
		solveType();
	}
	
	public String toString() {
		return String.format("%d.  %s  %s  %s  %s  %s  %.2f  %d  %.2f  %.2f  %.2f  %s", invoiceNumber,
				date , number, companyName, adress, descr, cenaNetto,
				vat, kwotaVat, cenaBrutto, cenaNettodod, type );
	}

	
	private void solveType(){
		
		if(isPrzychod)
			type = "przychod";
		else
			type = "koszt";
		
	}
	
	public int getMonth(){
		return m;
	}
	
	public int getInvCount(){
		return invoiceNumber;
	}
	

}
